<?php

/*******************************************************************************
 * 
 * Paradygm Usage Example File # 1
 * 
 * Simple example of « how to » use Paradygm in simple use case.
 * 
 * @author Stanislas PERRIN <stanislas.perrin@gmail.com> <stan@extramuros.com>
 * 
 ******************************************************************************/

/**
 * 
 * Debugger configuration
 * 
 * It's mandatory, unless you modify the 'debug.class.php' file in order to
 * add default values ton configuration variables.
 * 
 * You can include a debug.conf.php file if you feel it more convenient to your
 * way of programming.
 * 
 */

$_DEBUG_APPNAME = 'test';					// Name of debugged/tracked application (usefull if you track more than one app)
$_DEBUG_LOGPATH = './log';					// Path to store logfile
$_DEBUG_MAILTO = 'debug@debug.com';			// Mail address to whom send the bug report
$_DEBUG_MAILFROM = 'test.debug@test.com';	// Mail address from whom it is supposed sended by
$_DEBUG_SENDMAIL = false;					// Send a mail on error
$_DEBUG_WRITELOG = false;					// Write error in a logfile ?
$_DEBUG_SHOWERROR = false;					// Show error in the current HTML file ?
$_DEBUG_SYSLOG = true;						// write to Linux Syslog ? 
$_DEBUG_VERBOSE = 'VV';						// Verbosity level of the bug report (V = few words / VV = some words / VVV = talkative)
$_DEBUG_CATCH_PHP_ERRORS = true;

# ------------------------------------------------------------------------------
# Includes
# ------------------------------------------------------------------------------

// debug.class.php is mandatory 
include_once('../debug.class.php');
include_once('../dbconnection.class.php');
include_once('../db.class.php');
include_once('../dbo.class.php');
include_once('produit.class.php');

// include your own classes object-to-tables classes
include_once('person.class.php');

$dbc = new dbconnection('localhost', '3306', 'user', 'user', 'gestfact');
$p = new produit($dbc);
$p-> open('P2');
print("\nID de l'objet : "); print_r($p->getId());
print("\nRequête : "); print_r($p->getQueryString());
print("\nPropriétés de l'objet :\n"); print_r($p->getAllProperties());
$p->setProperty('NomPdt', "super porte");
print("\nPropriétés de l'objet :\n"); print_r($p->getAllProperties());
$p->save();
print("\nRequête : "); print_r($p->getQueryString());
print("\n");

?>
